<template>
  <image
    :style="{ width: width + 'rpx', height: width + 'rpx' }"
    :src="checked ? activeIcon : icon"
    mode="widthFix"
    class="check-img"
    @click="onClick"
  />
</template>

<script>
import { imgBaseUrlV2 } from "@/common/config";
export default {
  props: {
    icon: {
      type: String,
      default: imgBaseUrlV2 + "check_diy.png",
    },
    activeIcon: {
      type: String,
      default: imgBaseUrlV2 + "check_diy_h.png",
    },
    checked: {
      default: false,
    },
    width: {
      default: 32,
    },
  },
  methods: {
    onClick() {
      this.$emit("click");
    },
  },
};
</script>

<style lang="scss" scoped>
.check-img {
  width: 32rpx;
  height: 32rpx;
}
</style>